package cn.yunhe.crm.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.yunhe.crm.dao.EmpMapper;
import cn.yunhe.crm.entity.Emp;
import cn.yunhe.crm.entity.EmpExample;

@Service("userinfobiz")
public class UserinfoService {
	@Autowired
	private EmpMapper empdao;
	public void setEmpdao(EmpMapper empdao) {
		this.empdao = empdao;
	}
	/**
	 * 
	 * @return Ա����Ϣ����
	 */
	public List userinfolist(Map<String, Integer> map) {
		List list=empdao.emplist(map);
		return list;
	}
	/**
	 *  ����û�/�޸�
	 * @return
	 */
	public int useraddorupdate(Emp emp) {
		int i=0;
		i=empdao.updateByPrimaryKeySelective(emp);
		return i;
	}
	/**
	 * 
	 * @return
	 */
	public List unuserlist() {
		EmpExample example=new EmpExample();
		example.createCriteria().andUsernameIsNull().andPasswordIsNull().andRoleidIsNull();
		List list=empdao.selectByExample(example);
		return list;
	}
}
